force keyboard to show android programmatically

90

fun View.showKeyboard() = ViewCompat.getWindowInsetsController(this)
    ?.show(WindowInsetsCompat.Type.ime())
    
//Now you can just call editText.showKeyboard() to show the keyboard for the EditText
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);

Comments

Submit
0 Comments